const {
	get,
	post,
	put,
	del
} = require("@/utils/request")
const {
	COM_URL
} = require("@/utils/config")
// #ifdef MP
const {
	APPID
} = require("@/utils/config")
uni.setStorageSync('appid', APPID)
const api = `${COM_URL}`
//#endif
// 登录
export function login(data) {
	return post(`${api}/defectManager/login`, data, 'application/json;charset=utf-8', 'token', true)
}
// 角色
export function auth(data) {
	return post(`${api}/defectManager/auth`, data, 'application/json;charset=utf-8', 'token', true)
}

// 缺陷删除
export function deleteDefect(data) {
	return post(`${api}/manager/deleteDefect`, data, 'application/json;charset=utf-8', 'token', true)
}
// 缺陷导出
export function exportDefect(data) {
	return post(`${api}/manager/exportDefect`, data, 'application/json;charset=utf-8', 'token', true)
}
// 根据设备类型、缺陷描述和部件类型、缺陷性质查询分类依据
export function findClassificationBasis(data) {
	return post(`${api}/manager/findClassificationBasis`, data, 'application/json;charset=utf-8', 'token', true)
}
// 查询列表
export function findDefect(data) {
	return post(`${api}/manager/findDefect`, data, 'application/json;charset=utf-8', 'token', true)
}
// 根据缺陷编号查询缺陷
export function findDefectByCode(data) {
	return post(`${api}/manager/findDefectByCode`, data, 'application/json;charset=utf-8', 'token', true)
}
// 根据设备类型、缺陷描述和部件类型查询缺陷性质
export function findDefectNature(data) {
	return post(`${api}/manager/findDefectNature`, data, 'application/json;charset=utf-8', 'token', true)
}
// 查询缺陷数量
export function findDefectNum(data) {
	return post(`${api}/manager/findDefectNum`, data, 'application/json;charset=utf-8', 'token', true)
}
// 根据设备类型和部件类型查询缺陷描述	
export function findDescription(data) {
	return post(`${api}/manager/findDescription`, data, 'application/json;charset=utf-8', 'token', true)
}
// 根据电站名称、设备类型和电压 查询设备名称
export function findDeviceName(data) {
	return post(`${api}/manager/findDeviceName`, data, 'application/json;charset=utf-8', 'token', true)
}
// 根据电站名称和电压 查询设备类型
export function findDeviceType(data) {
	return post(`${api}/manager/findDeviceType`, data, 'application/json;charset=utf-8', 'token', true)
}

// 字典表
export function findDictionary(data) {
	return post(`${api}/manager/findDictionary`, data, 'application/json;charset=utf-8', 'token', true)
}
// 根据设备类型查询部件类型
export function findPartType(data) {
	return post(`${api}/manager/findPartType`, data, 'application/json;charset=utf-8', 'token', true)
}

// 根据运维单位查询电站
export function findStation(data) {
	return post(`${api}/manager/findStation`, data, 'application/json;charset=utf-8', 'token', true)
}
// 增加/修改缺陷
export function saveAndUpdateDefect(data) {
	return post(`${api}/manager/saveAndUpdateDefect`, data, 'application/json;charset=utf-8', 'token', true)
}
// 消缺审核
export function xiaoqueshenhe(data) {
	return post(`${api}/manager/examineDefect`, data, 'application/json;charset=utf-8', 'token', true)
}
// 消缺审核获取total
export function shenhegetnum(data) {
	return post(`${api}/manager/auditFailedDefectNum`, data, 'application/json;charset=utf-8', 'token', true)
}
// 消缺审核获取total
export function shenhegetlist(data) {
	return post(`${api}/manager/auditFailedDefect`, data, 'application/json;charset=utf-8', 'token', true)
}
// 消缺
export function solveDefect(data) {
	return post(`${api}/manager/solveDefect`, data, 'application/json;charset=utf-8', 'token', true)
}
// 上传图片
export function uploadPic(data) {
	return post(`${api}/manager/uploadPic`, data, 'application/json;charset=utf-8', 'token', true)
}

// 电压
export function findVoltage(data) {
	return post(`${api}/manager/findVoltage`, data, 'application/json;charset=utf-8', 'token', true)
}

// 解析vi
export function decode(data) {
	return post(`${api}/defectManager/decode`, data, 'application/json;charset=utf-8', 'token', true)
}

// 修改姓名
export function updateUsername(data) {
	return post(`${api}/manager/updateUsername`, data, 'application/json;charset=utf-8', 'token', true)
}

// 查询告警缺陷数量
export function findWarnDefect(data) {
	return post(`${api}/manager/findWarnDefect`, data, 'application/json;charset=utf-8', 'token', true)
}

// 查询告警缺陷列表
export function findWarnDefectNum(data) {
	return post(`${api}/manager/findWarnDefectNum`, data, 'application/json;charset=utf-8', 'token', true)
}

//   查询告警缺陷总数量
export function findWarnDefectTotalNum(data) {
	return post(`${api}/manager/findWarnDefectTotalNum`, data, 'application/json;charset=utf-8', 'token', true)
}